home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 June
/
EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso
/
earcd
/
comm1
/
intsdkss.lha
/
examples
/
sockinit.c
< prev
Wrap
C/C++ Source or Header
|
1996-04-09
|
560b
|
32 lines
void __regargs __autoopenfail(char *);
#include <proto/exec.h>
#include <ss/socket.h>
struct Library *SockBase;
static void *libbase;
extern int errno;
int __stdargs _STI_opensock(void)
{
SockBase = libbase = (void *)OpenLibrary("inet:libs/socket.library", 6);
if (SockBase == NULL)
{
__autoopenfail("inet:libs/socket.library");
return 1;
}
setup_sockets(FD_SETSIZE, &errno);
return 0;
}
void __stdargs _STD_closesock(void)
{
if (libbase)
{
cleanup_sockets();
CloseLibrary(libbase);
libbase = SockBase = NULL;
}
}